<template>
  <div>
    首页
  </div>
</template>

<script>
  export default{
    methods:{
      onLoad(){
        var that=this;
        this.$axios.post('/admin.php/index/index',{id:1}).then(
          (res)=>{
            if(res.data.code==1){
              that.$message({
                message: '恭喜你，这是一条成功消息',
                type: 'success'
              });
            }else{
              that.$message({
                message: '这是一条警告消息',
                type: 'waring'
              });
            }
          }
        ).catch(
          (res)=>{
            alert('no');
          }
        )
      }
    },
    created(){
      this.onLoad();
    }
  }
</script>

<style>
</style>
